{include file="public/header" /}
<div class="header">
	<span>用户列表</span>
	<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="add()">
		<i class="layui-icon layui-icon-add-1"></i>添加
	</button>
	<div></div>
</div>
<table class="layui-table">
	<thead>
		<tr>
			<th>用户ID</th>
			<th>手机号</th>
			<th>昵称</th>
			<th>性别</th>
			<th>老师</th>
			<th>状态</th>
			<th>注册时间</th>
			<th>登录时间</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		{volist name="lists" id='vo'}
			<tr>
				<td>{$vo.uid}</td>
				<td>{$vo.phone}</td>
				<td>{$vo.nickname}</td>
				<td>
					{if($vo['sex'] == 0)}
						保密
					{elseif($vo['sex'] == 1)/}
						男
					{elseif($vo['sex'] == 2)}
						女
					{/if}
				</td>
				<td>
					{if($vo['is_teacher'] == 0)}
						否
					{elseif($vo['is_teacher'] == 1)/}
						是
					{/if}
				</td>
				<td>{$vo.status==1?'开启':'<span style="color:red;">禁用</span>'}</td>
				<td>{:date('Y-m-d H:i:s',$vo.add_time)}</td>
				<td>{:date('Y-m-d H:i:s',$vo.last_time)}</td>
				<td>
					<button type="button" class="layui-btn layui-btn-primary layui-btn-xs" onclick="edit({$vo.uid})">
						<i class="layui-icon layui-icon-edit"></i>编辑
					</button>
				</td>
			</tr>
		{/volist}
	</tbody>
</table>
<script type="text/javascript">
	layui.use(['layer'],function(){
		layer = layui.layer;
		$ = layui.jquery;
	});
	// 添加
	function add(){
		layer.open({
			type: 2,
			title: '添加',
			shade: 0.3,
			area: ['450px','550px'],
			content: "{$config['admin_route']}oyk/user_add"
		});
	}
	// 编辑
	function edit(uid){
		layer.open({
			type: 2,
			title: '编辑',
			shade: 0.3,
			area: ['450px','550px'],
			content: "{$config['admin_route']}oyk/user_edit?uid="+uid
		});
	}
</script>
{include file="public/tail" /}